<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="utf-8" />
        <title>TipLayer - ESUI Demo</title>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="assets/google-code-prettify/prettify.css" />
        <link rel="stylesheet" href="assets/themes/standard.css" />
        <!--[if lt IE 9]>
        <link rel="stylesheet" href="assets/ie8.css" />
        <![endif]-->
    </head>
    <body>
        <div class="header">
            <h1 id="branding">ESUI - TipLayer</h1>
        </div>
        <div class="ui-g main-container">
            <div id="side-bar" class="ui-u-1-5">
                <ul id="navigator" class="ui-nav">
                </ul>
            </div>
            <div id="main" class="ui-u-4-5">
                <h2>基本TipLayer</h2>
                <p>可以把TipLayer绑定到一个ESUI控件上或DOM元素。</p>
                <div class="example">
                    <h3>绑定到控件</h3>
                    <div class="row">
                        <button type="button" data-ui-id="control-tip" data-ui-type="Button">
                            Hover to see Help
                        </button>
                    </div>
                    <div class="row">
                        <button type="button" data-ui-id="control-tip-2" data-ui-type="Button">
                            共享一个TipLayer
                        </button>
                    </div>
                    <h3>绑定到DOM</h3>
                    <div class="row">
                        <a href="#" id="tip-layer-label">
                            See Help <span class="ui-icon-question"></span>
                        </a>
                    </div>
                </div>

                <h2>使用AutoTipLayerExtension创建</h2>
                <div class="example">
                    <h3>绑定到控件</h3>
                    <div class="row">
                        <div data-ui-type="Panel" data-ui-id="panel2" data-ui-variants="custom"
                            data-ui-extension-autotiplayer-type="AutoTipLayer">
                            <div class="ui-panel-body">
                                Body content
                                <a href="#" data-role="tip" data-tip-title="title" data-tip-content="content" data-ui-type="Link">Child link control</a>
                                <a href="#" data-role="tip" data-tip-content="content" data-ui-type="Link">No Title</a>
                            </div>
                        </div>
                    </div>
                </div>
                <script type="text/sample" data-refid="main-js">
                </script>
            </div>
        </div>
        <script src="assets/loader/esl.js"></script>
        <script src="config.js"></script>
        <script src="demo.js"></script>
        <script src="assets/google-code-prettify/prettify.js"></script>
        <script id="main-js">
        require(
            [
                'esui',
                'esui/TipLayer',
                'esui/Panel',
                'esui/extension/AutoTipLayer',
                'esui/Tab',
                'demo'
            ],
            function (ui, TipLayer) {
                ui.init();

                var tipLayer = ui.create('TipLayer', {
                    title: '最普通的提示',
                    content: '随便提示一下随便提示一下随便提示一下'
                });

                tipLayer.attachTo({
                    targetControl: 'control-tip',
                    showMode: 'over',
                    delayTime: 300,
                    positionOpt: { top: 'top', right: 'right' },
                    targetPositionOpt: { top: 'top', right: 'left' }
                    
                });

                tipLayer.attachTo({
                    targetControl: 'control-tip-2',
                    showMode: 'over',
                    delayTime: 300,
                    positionOpt: { top: 'top', right: 'left' }
                });
                
                tipLayer.attachTo({
                    targetDOM: 'tip-layer-label',
                    showMode: 'over',
                    delayTime: 300,
                    positionOpt: { top: 'top', right: 'left' }
                });
            }
        );
        </script>
        <script src="sitemap.js"></script>
    </body>
</html>
